using System;
using System.ComponentModel;
using System.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ApiTest2.Entitys
{
    /// <summary>
    /// 链接
    /// </summary>  
    /// <remarks>
    /// <![CDATA[ENGINE=InnoDB  COMMENT='链接']]>
    /// </remarks>
    [DbSource("Default"), Serializable]
    public class AppLink
    {
        /// <summary>
        /// link_id
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '']]>
        /// </remarks>
        [Primary(Automatic = true)]
        public int LinkId { get; set; }

        [JsonConverter(typeof(AutoEnumConverter))]
        public LinkTypeEnum LinkTypeName => (LinkTypeEnum)LinkType;

        /// <summary>
        /// 连接类型 【MP=小程序,WEB=网页】
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '连接类型 【MP=小程序,WEB=网页】']]>
        /// </remarks>
        [Column(false)]
        [DisplayName("连接类型")]
        public int LinkType { get; set; }

        /// <summary>
        /// link_name
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(64) DEFAULT NULL COMMENT '']]>
        /// </remarks>
        [Column(64)]
        public string LinkName { get; set; }

        /// <summary>
        /// 连接规则
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(128) DEFAULT NULL COMMENT '连接规则']]>
        /// </remarks>
        [Column(128)]
        [DisplayName("连接规则")]
        public string LinkPathFormat { get; set; }

    }
}
